#include <stdio.h>
#include "List.h"


void PrintList(const List L)
{
    Position P = Header(L);

    if (IsEmpty(L))
    {
        printf("Empty List\n");
    }
    else
    {
        do
        {
            P = Advance(P);
            printf("%d ", Retrieve(P));
        } while(!IsLast(P, L));
        printf("\n");
    }
}

int main()
{
    List L;
    Position P;
    int i = 0;
    L = MakeEmpty(NULL);
    P = Header(L);
    PrintList(L);
    for (i=0; i<10; i++)
    {
        Insert(i,L,P);
        P = Advance(P);
        PrintList(L);
    }
    for (i=0; i<10; i+=2)
    {
        Delete(i,L);
        PrintList(L);
    }
    return 0;
}